package KeBenAnLi;
import java.util.Scanner;
public class 商场购物程序设计 {
    public static void main(String[] args) {
        int number;
        int quantity;
        double money;
        Scanner sc=new Scanner(System.in);
        System.out.println("输入商品序列号:");
        number=sc.nextInt();
        String [] name=new String[5];
        double [] price=new double [5];
        name[0]="牙刷";
        name[1]="毛巾";
        name[2]="水杯";
        name[3]="苹果";
        name[4]="香蕉";
        price[0]=8.8;
        price[1]=10.0;
        price[2]=18.8;
        price[3]=12.5;
        price[4]=15.5;
        while(true)
        {
            System.out.println(name[number - 1]);
            System.out.println("请输入购买数量:");
            quantity = sc.nextInt();
            money = price[number - 1] * quantity;
            System.out.println("需要花费:" + money + "元");
            System.out.println("请输入是否继续够买:");
            char a=sc.next().charAt(0);
            char b='Y';
            System.out.println();
            //a.equals(b);
            if(a==b)
            {
              System.out.println("继续购物~~");
            }
            else
            {
                break;
            }
        }
    }
}
